package com.wing.product.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.common.utils.JsonResult;
import com.wing.product.model.entity.ProductPackLabel;
import com.wing.product.model.request.ProductPackLabelForm;
import com.wing.product.model.response.ProductPackLabelVO;

import java.util.List;
import java.util.Map;

/**
 * 产品包装条码-Service
 *
 * @author
 */
public interface ProductPackLabelService extends IService<ProductPackLabel> {

    /**
     * 添加
     *
     * @param productPackLabelForm
     * @return
     */
    int add(ProductPackLabelForm productPackLabelForm);

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<ProductPackLabelVO> list4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    Page<ProductPackLabelVO> pageList4app(Page page, Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    ProductPackLabelVO get4appById(Long id);

    /**
     * 产品包装标签vo列表
     *
     * @param code 代码
     * @return {@link List}<{@link ProductPackLabelVO}>
     */
    ProductPackLabelVO getProductPackLabelVoList(String code);

    /**
     * 得到条形码
     *
     * @param code 代码
     * @return {@link String}
     */
    String getBarCode(String code);

    /**
     * 添加标签条码
     *
     * @param productPackLabelForm 产品包装标签形式
     * @return int
     */
    List<ProductPackLabel> inertPackIndex(ProductPackLabelForm productPackLabelForm) ;
    /**
     * 添加标签条码
     *
     * @param productPackLabelForm 产品包装标签形式
     * @return int
     */
    List<ProductPackLabel> inertPackIndex2(ProductPackLabelForm productPackLabelForm) ;

    ProductPackLabelForm extractLabel4InventoryIn(String code,Integer extract,Integer addCount);

    ProductPackLabelForm extractLabel4InventoryIn(String code,Integer extract,Integer addCount,Long boxId,Long warehouseId,Long areaId,Long shelfId,Long spaceId);

    ProductPackLabelForm extractLabel4InventoryOut(String code, Integer extract,Integer addCount);

    /**
     * 入库计划 打印条码列表
     * @param page
     * @param limit
     * @param planId
     * @return
     */
    IPage<ProductPackLabelVO> getInventoryPackLabelPageList(Integer page, Integer limit, Long planId);

    ProductPackLabelVO getPackLabelVOByCode(Long planId,String code,Long warehouseId);

    JsonResult<ProductPackLabelVO> getByCode(String code, Long deliveryId);

    JsonResult<ProductPackLabelVO> getLabelByCode(String code);

}
